package com.songtech.auth.role.model;

import java.util.Date;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.songtech.auth.role.vo.RoleResourceVo;
import com.songtech.auth.role.vo.RoleUserVo;

@Entity
@Table(name = "role")
public class Role {
	@Id
	@Column(name = "id")
	private String id;
	/**
	 * 角色名
	 */
	@Column(name = "name")
	private String name;
	/**
	 * 角色代码标识（唯一）
	 */
	@Column(name = "code")
	private String code;
	@Column(name = "note")
	private String note;
	@Column(name = "state")
	private int state;
	/**
	 * 新增时间
	 */
	@Column(name= "create_time")
	private Date createTime;
	/**
	 * 新增人
	 */
	@Column(name= "create_user")
	private String createUser;
	/**
	 * 修改时间
	 */
	@Column(name= "update_time")
	private Date updateTime;
	/**
	 * 修改人
	 */
	@Column(name= "update_user")
	private String updateUser;
	/**
	 * 拥有的资源关系
	 */
	@Transient
	List<RoleResourceVo> resources;
	/**
	 * 角色关联的用户关系
	 */
	@Transient
	List<RoleUserVo> roleUser;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	public String getNote() {
		return note;
	}
	public void setNote(String note) {
		this.note = note;
	}
	public int getState() {
		return state;
	}
	public void setState(int state) {
		this.state = state;
	}
	public Date getCreateTime() {
		return createTime;
	}
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	public String getCreateUser() {
		return createUser;
	}
	public void setCreateUser(String createUser) {
		this.createUser = createUser;
	}
	public Date getUpdateTime() {
		return updateTime;
	}
	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}
	public String getUpdateUser() {
		return updateUser;
	}
	public void setUpdateUser(String updateUser) {
		this.updateUser = updateUser;
	}
	public List<RoleResourceVo> getResources() {
		return resources;
	}
	public void setResources(List<RoleResourceVo> resources) {
		this.resources = resources;
	}
	public List<RoleUserVo> getRoleUser() {
		return roleUser;
	}
	public void setRoleUser(List<RoleUserVo> roleUser) {
		this.roleUser = roleUser;
	}
}
